import request from '@/config/axios'

// 图集内容 VO
export interface ContentImageVO {
  id: number // 图集ID
  menuId: number // 菜单ID
  title: string // 标题
  url: string // 图集URL
  status: number // 审批结果
}

// 图集内容 API
export const ContentImageApi = {
  // 查询图集内容分页
  getContentImagePage: async (params: any) => {
    return await request.get({ url: `/cms/content-image/page`, params })
  },

  // 查询图集内容详情
  getContentImage: async (id: number) => {
    return await request.get({ url: `/cms/content-image/get?id=` + id })
  },

  getByMenuId: async (menuId: number) => {
    return await request.get({ url: `/cms/content-image/getByMenuId?menuId=${menuId}` })
  },

  // 新增图集内容
  createContentImage: async (data: ContentImageVO) => {
    return await request.post({ url: `/cms/content-image/create`, data })
  },

  // 修改图集内容
  updateContentImage: async (data: ContentImageVO) => {
    return await request.put({ url: `/cms/content-image/update`, data })
  },

  // 删除图集内容
  deleteContentImage: async (id: number) => {
    return await request.delete({ url: `/cms/content-image/delete?id=` + id })
  },

  // 导出图集内容 Excel
  exportContentImage: async (params) => {
    return await request.download({ url: `/cms/content-image/export-excel`, params })
  },
}
